<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWithdrawsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('withdraws', function (Blueprint $table) {
            $table->increments('id');
            $table->bigInteger('agent_id')->index();
            $table->decimal('number')->default('0')->comment('提现金额');
            $table->decimal('charge')->default('0')->comment('手续费');
            $table->tinyInteger('method')->default('1')->comment('1银行卡，2微信，3支付宝');
            $table->string('receiver')->nullable();
            $table->string('bank')->nullable();
            $table->string('no')->nullable();
            $table->string('qr')->nullable();
            $table->tinyInteger('state')->index()->default('0')->comment('0已提交，-1已拒绝，1已打款');
            $table->string('remark')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('withdraws');
    }
}
